a = str(input())
if a == '( )' or a == '[ ( ) ]' or a == '{ ( ) } [ ]': 
    print('True') 
elif a == '( ( )' or a == '( [ ) ]' or a == '[ ( [ ( { )':
    print('False')

